From ac94569ff63144d0fb2b9aebe177006bb3b76f3e Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Wed, 5 Jul 2006 10:03:20 -0600 Subject: [PATCH] [IA64] fix domain_flush_vtlb_all() It should purge software tlb entry of specified vcpu, not current. Signed-off-by: Isaku Yamahata --- xen/arch/ia64/xen/vcpu.c | 2 +- xen/arch/ia64/xen/vhpt.c | 18 ++++++++++-------- xen/include/asm-ia64/tlbflush.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c index 227cd8cd72..d820c7faf6 100644 --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -2065,7 +2065,7 @@ IA64FAULT vcpu_ptc_e(VCPU *vcpu, UINT64 vadr) // architected loop to purge the entire TLB, should use // base = stride1 = stride2 = 0, count0 = count 1 = 1 - vcpu_flush_vtlb_all (); + vcpu_flush_vtlb_all(current); return IA64_NO_FAULT; } diff --git a/xen/arch/ia64/xen/vhpt.c b/xen/arch/ia64/xen/vhpt.c index 895e8bc0fe..cbd40e4abf 100644 --- a/xen/arch/ia64/xen/vhpt.c +++ b/xen/arch/ia64/xen/vhpt.c @@ -129,10 +129,8 @@ void vhpt_init(void) } -void vcpu_flush_vtlb_all (void) +void vcpu_flush_vtlb_all(struct vcpu *v) { - struct vcpu *v = current; - /* First VCPU tlb. */ vcpu_purge_tr_entry(&PSCBX(v,dtlb)); vcpu_purge_tr_entry(&PSCBX(v,itlb)); @@ -148,6 +146,11 @@ void vcpu_flush_vtlb_all (void) check this. */ } +static void __vcpu_flush_vtlb_all(void *vcpu) +{ + vcpu_flush_vtlb_all((struct vcpu*)vcpu); +} + void domain_flush_vtlb_all (void) { int cpu = smp_processor_id (); @@ -158,12 +161,11 @@ void domain_flush_vtlb_all (void) continue; if (v->processor == cpu) - vcpu_flush_vtlb_all (); + vcpu_flush_vtlb_all(v); else - smp_call_function_single - (v->processor, - (void(*)(void *))vcpu_flush_vtlb_all, - NULL,1,1); + smp_call_function_single(v->processor, + __vcpu_flush_vtlb_all, + v, 1, 1); } } diff --git a/xen/include/asm-ia64/tlbflush.h b/xen/include/asm-ia64/tlbflush.h index eafdf0b9d7..a0babd8d65 100644 --- a/xen/include/asm-ia64/tlbflush.h +++ b/xen/include/asm-ia64/tlbflush.h @@ -11,7 +11,7 @@ */ /* Local all flush of vTLB. */ -void vcpu_flush_vtlb_all (void); +void vcpu_flush_vtlb_all(struct vcpu *v); /* Local range flush of machine TLB only (not full VCPU virtual TLB!!!) */ void vcpu_flush_tlb_vhpt_range (u64 vadr, u64 log_range); -- 2.30.2